
import { Entity,  Column,  Index, PrimaryGeneratedColumn,CreateDateColumn,UpdateDateColumn } from 'typeorm';
            
@Index('uk_dictName',['dictName'],{ unique: true })
@Entity("dict")
export class Dict {
            
    @PrimaryGeneratedColumn({ name: 'id', type: 'int', comment: 'ID' })
    id!: number;
                
    @Column({
        name: 'dict_name',
        type: 'varchar',
        length: 255, 
        nullable: false,
        comment: '名称',
                            
    })
    dictName!: string;
                
    @Column({
        name: 'status',
        type: 'tinyint',
        
        nullable: false,
        comment: '状态',
        default: 1,                    
    })
    status?: number;
                
    @CreateDateColumn({
        name: 'created_at',
        type: 'datetime',
        default: () => 'CURRENT_TIMESTAMP',
        nullable: false,
        comment: '创建时间',
        precision:0
    })
    createdAt!: Date;              
                
    @UpdateDateColumn({
        name: 'updated_at',
        type: 'datetime',
        default: () => 'CURRENT_TIMESTAMP',
        onUpdate: 'CURRENT_TIMESTAMP',
        nullable: false,
        comment: '更新时间',
        precision:0
    })
    updatedAt!: Date;
                
    @Column({
        name: 'comment',
        type: 'varchar',
        length: 255, 
        nullable: true,
        comment: '备注',
                            
    })
    comment?: string;
                
}
